package com.huawei.leetcode;

public class Code11 {
    public static void main(String[] args) {

    }

    /**
     * 超出时间限制
     * @param height
     * @return
     */
    public int maxArea(int[] height) {
        int maxArea = 0;
        for (int i = 0; i < height.length; i++) {
            for (int j = i + 1; j < height.length; j++) {
                int wide = j - i;
                int high = Math.min(height[i], height[j]);
                if (maxArea < wide * high) {
                    maxArea = wide * high;
                }
            }
        }
        return maxArea;
    }
}
